package o;

import com.huawei.appgallery.foundation.card.base.bean.AppInfoBean;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class dty {
    private static final String ˋ = dty.class.getSimpleName();
    private static dty ˎ = null;
    private static final Object ॱ = new Object();
    private List<AppInfoBean> ˊ = null;
    private String ˏ = "";

    private dty() {
        Logger.ˎ("APP_SYN", ˋ + " MultyDeviceSynReserveManager() ");
        this.ˊ = (List) new cfp(epp.ॱ(".appSynDownloadQueue")).ˎ();
        if (this.ˊ == null) {
            this.ˊ = new ArrayList();
        }
        this.ˏ = (String) new cfp(epp.ॱ(".appSynDownloadingPkg")).ˎ();
        if (this.ˏ == null) {
            this.ˏ = "";
        }
    }

    public static dty ॱ() {
        dty o_dty;
        synchronized (ॱ) {
            if (ˎ == null) {
                ˎ = new dty();
            }
            o_dty = ˎ;
        }
        return o_dty;
    }

    public void ˏ(AppInfoBean appInfoBean) {
        Logger.ˎ("APP_SYN", ˋ + " removeFromDownloadQueue");
        if (!CollectCheck.isEmpty(this.ˊ)) {
            Iterator it = this.ˊ.iterator();
            while (it.hasNext()) {
                AppInfoBean appInfoBean2 = (AppInfoBean) it.next();
                String ˏॱ = appInfoBean.ˏॱ();
                if (!dof.ˋ(ˏॱ) && ˏॱ.equals(appInfoBean2.ˏॱ())) {
                    it.remove();
                    Logger.ˎ("APP_SYN", ˋ + " removeFromDownloadQueue pkg=" + ˏॱ);
                    break;
                }
            }
        }
        new cfp(epp.ॱ(".appSynDownloadQueue")).ˎ(this.ˊ);
    }

    public void ˊ(List<AppInfoBean> list) {
        this.ˊ.addAll(list);
        new cfp(epp.ॱ(".appSynDownloadQueue")).ˎ(this.ˊ);
    }

    public List<AppInfoBean> ˋ() {
        return this.ˊ;
    }

    public void ˊ() {
        Logger.ˎ("APP_SYN", ˋ + " clear()");
        if (this.ˊ != null) {
            this.ˊ.clear();
            new cfp(epp.ॱ(".appSynDownloadQueue")).ˎ(this.ˊ);
        }
    }

    public String ˎ() {
        return this.ˏ;
    }

    public void ˊ(String str) {
        this.ˏ = str;
        new cfp(epp.ॱ(".appSynDownloadingPkg")).ˎ(str);
    }
}
